package ncku.account.gui;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JMenu;
import javax.swing.JMenuItem;

import ncku.account.gui.toolBarChart.Line_Chart;

/*
  MenuButton Exit 的class
  */


public class toolBarExit {
	JMenu exitMenu;
	JMenuItem close_windowItem; 
	 
	
	public toolBarExit(){
		
		exitMenu = new JMenu ("系統");
		//新增按鈕
        close_windowItem = new JMenuItem ("離開程式");
        //加入listener，listener 的函式在下方Exit class
        close_windowItem.addActionListener(new Exit());
        //加入按鈕
        exitMenu.add (close_windowItem);

	}

	
	class Exit implements ActionListener{
		//動作函式
		@Override
		public void actionPerformed(ActionEvent e) {
			//關閉程式
			System.exit(0);
		}
	
	
	}
}
